import java.util.ArrayList;
import java.util.HashMap;

public class Test {
    public static void main(String[] args) {
        String str="abcdefg";
        Solution s=new Solution();
        s.reverseLeftWords(str,2);
    }
    public static void main1(String[] args) {
        String str="hello word";
        char [] arr1=str.toCharArray();
        String [] arr=str.split(" ");
        ArrayList<String> ret=new ArrayList<>();
        for(int i=0;i<arr.length;i++){
            ret.add(0,arr[i]);
        }
        String s=ret.toString();
        System.out.println(s);
    }
}
